package com.deanlib.cabinet.base;

import androidx.annotation.NonNull;

import com.deanlib.cabinet.data.network.Response;

import java.util.Optional;

import io.reactivex.Observable;
import io.reactivex.functions.Action;
import io.reactivex.functions.Consumer;

/**
 * Created by Dean on 2021/6/19
 */
public interface INetworkAuxiliary {

    <T> void request(@NonNull Observable<Response<T>> observable, Consumer<Optional<T>> next);
    <T> void request(@NonNull Observable<Response<T>> observable, Consumer<Optional<T>> next,
                            Consumer<? super Throwable> error);
    <T> void request(@NonNull Observable<Response<T>> observable, Consumer<Optional<T>> next,
                            Consumer<? super Throwable> error, Action complete);
    void dispose();
}
